static forEachTest(namespace: any, callback: (name: string, _this_: any, test: () => void) => void) { notStarted = ko.observableArray<TestCase>([]);
running = ko.observableArray<TestCase>([]);
succeeded = ko.observableArray<TestCase>([]);
failed = ko.observableArray<TestCase>([]);
private _continueStartingClosure = () => this._continueStarting();
private _updateTimesInterval: number = null;
namespace: any = teapo.tests,
private _queueWorkItem: (action: () => void) => void = action => setTimeout(action, 10)) { this._loadTests(namespace);
if (this._updateTimesInterval) { clearInterval(this._updateTimesInterval);
this._updateTimesInterval = null;
this._updateTimesInterval = setInterval(() => this._updateTimes(), 100);
this._continueStarting();
if (this.running().length + this.notStarted().length === 0) { clearInterval(this._updateTimesInterval);
this._updateTimesInterval = 0;
forEach(this.running(), t => t.updateTimes(now));
private _continueStarting() { forEach(this.running(), t => { var nextRest = dateNow() + this.workQuantum;
if (!this.notStarted().length)
if (!this.notStarted().length)
if (dateNow() >= nextRest) { this._queueWorkItem(this._continueStartingClosure);
var nextTest = this.notStarted.shift();
this.running.push(nextTest);